home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / dictionaries-common.postinst < prev    next >
Encoding:
Text File  |  2006-12-19  |  3.1 KB  |  94 lines

  1. #! /bin/sh
  2. # postinst script for dictionaries-common
  3.  
  4. set -e
  5.  
  6. # Sourcing debconf confmodule
  7. . /usr/share/debconf/confmodule
  8.  
  9. case "$1" in
  10.   configure)
  11.   #
  12.   # This will remove /usr/share/pspell/region-to-spelling.map diversion by
  13.   # dictionaries-common package and associated stuff if present
  14.   #
  15.     rm -f /var/cache/dictionaries-common/region-to-spelling.map 
  16.   # This next handles a bug in some dpkg versions not removing 
  17.   # the symlink properly when upgrading
  18.     if [ -L /usr/share/pspell/region-to-spelling.map ]; then
  19.     RTS_DEST=`readlink /usr/share/pspell/region-to-spelling.map`
  20.     if [ "$RTS_DEST" = "/var/cache/dictionaries-common/region-to-spelling.map" ]; then
  21.         rm -f /usr/share/pspell/region-to-spelling.map 
  22.     fi
  23.     fi
  24.   # Removing the diversion if it still exists. trued just in case it does not,
  25.   # since grep returns error breaking postinst because of set -e otherwise.
  26.     DC_DIVERT=`dpkg-divert --list dictionaries-common | grep region-to-spelling.map` || true
  27.     if [ "$DC_DIVERT" ]; then
  28.     dpkg-divert --package  dictionaries-common --remove --rename \
  29.         --divert /usr/share/pspell/region-to-spelling.map.orig \
  30.         /usr/share/pspell/region-to-spelling.map
  31.     fi
  32.     #
  33.     # We no longer create the /usr/dict symlink
  34.     #
  35.     #
  36.     # This will check for obsolete /etc/dictionary link
  37.     #
  38.     if [ -L /etc/dictionary ]; then
  39.     db_get dictionaries-common/old_wordlist_link
  40.     if [ "$RET" = "true" ]; then
  41.         rm /etc/dictionary
  42.     fi
  43.     fi
  44.     #
  45.     # Ensure that automatic generation of files is done, such that we always
  46.     # start with a sane environment
  47.     #
  48.     if [ -e /var/cache/dictionaries-common/postinst.reconfiguring ]; then
  49.     /usr/sbin/update-default-ispell --rebuild
  50.     /usr/sbin/update-default-wordlist --rebuild
  51.     rm /var/cache/dictionaries-common/postinst.reconfiguring
  52.     else
  53.     /usr/sbin/update-default-ispell --rebuild --ignore-symlinks
  54.     fi
  55.     /usr/sbin/update-dictcommon-aspell
  56.     /usr/sbin/update-openoffice-dicts
  57.  
  58.     # Remove obsolete jed startup file
  59.     if [ -f /etc/jed-init.d/50dictionaries-common.sl ] ; then
  60.         echo "Removing obsolete /etc/jed-init.d/50dictionaries-common.sl" >&2
  61.         rm -f /etc/jed-init.d/50dictionaries-common.sl
  62.     fi
  63.     # That made this dir not be removed by dpkg. Remove it if exists, is non 
  64.     # empty, and jed-common is not installed
  65.     if [ -d /etc/jed-init.d ] && [ ! -e /etc/jed-init.d/00debian.sl ]; then
  66.         rmdir --ignore-fail-on-non-empty /etc/jed-init.d
  67.     fi
  68.     # Remove obsolete aspell-equivs file
  69.     if [ -f /var/cache/dictionaries-common/emacsen-aspell-equivs.el ] ; then
  70.         echo "Removing obsolete /var/cache/dictionaries-common/emacsen-aspell-equivs.el" >&2
  71.         rm -f /var/cache/dictionaries-common/emacsen-aspell-equivs.el
  72.     fi
  73.     
  74.   ;;
  75.  
  76.   abort-upgrade|abort-remove|abort-deconfigure)
  77.   ;;
  78.  
  79.   *)
  80.     echo "postinst called with unknown argument \`$1'" >&2
  81.     exit 0
  82.   ;;
  83. esac
  84.  
  85. # We need to test that there are emacsen installed before calling emacs-package-*
  86. if [ "$1" = "configure" ] && [ -x /usr/lib/emacsen-common/emacs-package-install ]
  87. then
  88.     [ -e /var/lib/emacsen-common/installed-flavors ] && /usr/lib/emacsen-common/emacs-package-install dictionaries-common
  89. fi
  90.  
  91.  
  92.  
  93. exit 0
  94.